package com.dao;

import com.pojo.Emp;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface EmpDAO extends JpaRepository<Emp,Integer> {

      @Query("from  Emp e  join fetch e.dep")
      List getAll();

      //@Modifying
      @Query(value = "select * from Emp",nativeQuery = true)
      List<Emp> getAll2();

      @Modifying
      @Query("delete  from Emp")
      public int delAll();




}
